﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace BambolettaDB
{
    /// <summary>
    /// Interaction logic for AddRequestDialog.xaml
    /// </summary>
    public partial class AddRequestDialog : Window
    {
        public AddRequestDialog()
        {
            InitializeComponent();
        }

        public AddRequestDialog(RequestVM edit)
        {
            InitializeComponent();
            AddRequestVM vm = Resources["AddRequest"] as AddRequestVM;
            if (vm != null)
            {
                vm.Edit(edit);
                Title = "Edit Request";
                AddButton.Content = "Update";
            }
        }

        private void CloseWindow(object sender, RoutedEventArgs e)
        {
            Close();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            Keyboard.Focus(First);
        }
    }
}
